package com.cd.service.technology.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cd.bean.Technology;
import com.cd.dao.TechnologyMapper;
import com.cd.service.technology.TechnologyService;

/**
 *技术服务
 *@Author zhk
 *@Date 2017-12-20
 **/
@Service("technologyService")
public class TechnologyServiceImpl implements TechnologyService{

	@Autowired
	TechnologyMapper technologyMapper;
	
	@Override
	public void save(Technology tec) throws Exception {
		technologyMapper.save(tec);
	}

	@Override
	public void delete(Integer id) throws Exception {
		technologyMapper.delete(id);
	}

	@Override
	public void edit(Technology tec) throws Exception {
		technologyMapper.update(tec);
	}

	@Override
	public List<Technology> listAll() throws Exception {
		// TODO Auto-generated method stub
		return technologyMapper.queryByList();
	}

	@Override
	public Technology findById(Integer id) throws Exception {
		// TODO Auto-generated method stub
		return technologyMapper.query(id);
	}

	@Override
	public void deleteAll() throws Exception {
		
	}

	@Override
	public Integer size() throws Exception {
		// TODO Auto-generated method stub
		return technologyMapper.getCount();
	}

	@Override
	public List<Technology> listLimit() throws Exception {
		// TODO Auto-generated method stub
		return technologyMapper.list();
	}

}
